package com.ido.otaclient;


/**
 * Copyright (c) 2019 深圳市爱都科技有限公司. All rights reserved.
 *
 * @Author: xyb
 * @CreateDate: 2020-02-20 15:45
 * @description
 */
public enum StatusDownload {
    //开始
    START(0),
    //下发完成
    COMPLETE(1),
    //下发失败
    ERROR(2);

    int code;
    StatusDownload(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static StatusDownload get(int code) {
        if (START.getCode() == code) {
            return START;
        } else if(COMPLETE.getCode() == code){
            return COMPLETE;
        }else {
            return ERROR;
        }
    }
}
